<?php
define('FPDF_FONTPATH','../fpdf/font/');
require('pagegroup.php');
include ("../../include/config.php");
require_once ("../../include/db.php");



class PDF extends PDF_PageGroup
{
function Footer()
{
	$this->SetY(-20);
	$this->Cell(0, 6, 'Page '.$this->GroupPageNo().'/'.$this->PageGroupAlias(), 0, 0, 'C');
}
}

$pdf = new PDF();
$pdf->SetFont('Arial', '', 12);
$pdf->StartPageGroup();
// Gegevens ophalen.
$ressql="SELECT * FROM jos_reservatie_reservaties WHERE Leerkrachtnaam='$lknaam'  ";
$resresult=mysql_query($ressql);
while ($rowres = mysql_fetch_array($resresult)) {
	$resuur = $rowres['Uur'];
	$lln = $rowres['Gebruikersnaam'];
	
$pdf->AddPage();
$tijdsql="SELECT * FROM jos_reservatie_parameters WHERE datum='30-06-2009'";
$tijdresult=mysql_query($tijdsql);

while ($rowtijd = mysql_fetch_array($tijdresult)) {
	$start = $rowtijd['Beginuur'];
	$eind = $rowtijd['Einduur'];
	$sessie = $rowtijd['Sessieduur'];
	$klasdirectie = $rowtijd['Klasdirectie'];

$aantaluren= $eind-$start;
$aantgespr = $aantaluren*60/$sessie;
//$tijd=$sessie*60;



$event_time = "$start";
$time_block = "$aantgespr";
$event_length = $sessie; // minutes
$teller2 = 0 ;
for($i = 0, $eTime = strtotime($event_time);
$i < $time_block;
$i++, $eTime = strtotime("+$event_length minutes", $eTime))
{
$new_event_time = date('H:i', $eTime);

	

$pdf->Image( "../images/alicebourg50.png" ,155 ,5,40,40);
//$pdf->Write(5, $new_event_time);
//$pdf->Write(5, " ($lkid) ");
//$pdf->Write(5, " ($lok) ");
//$pdf->Write(5,"\n\n");
			
						
																
$pdf->Cell(30,6,$new_event_time,1,0);
$pdf->Cell(85,6,$lln,1,1);
}}
}



$pdf->Output();

mysql_close();
?>
